Drop Down Menu With FramesA drop down menu can be targeted to another frame. For example, suppose that you have a dropdown in the upper frame of a framed page, and you want to target it at the lower frame. We might create this sort of frameset with the following code. Notice that we name the lower frameMAIN :
<FRAMESET ROWS="35%,*"> <FRAME SRC="ddf.titlebar.html" NAME=TITLEBAR> <FRAME SRC="ddf.lower.html" NAME=MAIN> <NOFRAMES>NOFRAMES stuff </NOFRAMES> </FRAMESET>
To create a drop down menu in the upper frame, we'll use the same script as described in the previous page. Copy the
following script exactly as-is into the
<SCRIPT TYPE="text/javascript"> <!-- function dropdown(mySel) { var myWin, myVal; myVal = mySel.options[mySel.selectedIndex].value; if(myVal) { if(mySel.form.target)myWin = parent[mySel.form.target]; else myWin = window; if (! myWin) return true; myWin.location = myVal; } return false; } //--> </SCRIPT>
The dropdown will use a select form like in the previous example. To target the dropdown at the lower frame we'll make one small change. In the
This select works almost the same as that in the
previous page. The Javascript checks if the |